<?=$header?>

<body>

	<?=$navigate?>

	<!-- MAIN CONTENT -->

    <div id="content">

		<?=$js?>

		<div class="page-full-width cf">



			<?=$sidebarleft?>

			

			<div class="side-content fr">

			

				

				<div class="content-module">

				

					<div class="content-module-heading cf">

					

						<h3 class="fl"><?=$title_page?></h3>

						<span class="fr expand-collapse-text">Click to collapse</span>

						<span class="fr expand-collapse-text initial-expand">Click to expand</span>

					

					</div> <!-- end content-module-heading -->

					

					

					<div class="content-module-main cf">

				    <?php echo form_open('staff/updateStaff/'.$staff['idstaff'], array('method'=>'POST', 'id'=>'kform')); ?>
                        <input type="text" id="idstaff" name="idstaff"  value="<?=$staff['idstaff']?>" style="display: none;" />
						<div class="half-size-column fl">

                            <?php 

                                $fieldCodeStaff = '';

                                $fieldLastName = '';

                                $fieldAddress = '';

                                $fieldFirstName = '';

                                $fieldMobile = '';

                                

                                $inputCodeError = '';

                                $inputLastNameError = '';

                                $inputFirstNameError = '';

                                $inputAddressError = '';

                                $inputMobileError = '';

                                

                                if(form_error('codestaff') != ''){

                                    $fieldCodeStaff = 'form-error';

                                    $inputCodeError = 'error-input';

                                }

                                if(form_error('lastname') != ''){

                                    $fieldLastName = 'form-error';

                                    $inputLastNameError = 'error-input';

                                }

                                if(form_error('firstname') != ''){

                                    $fieldFirstName = 'form-error';

                                    $inputFirstNameError = 'error-input';

                                }

                                if(form_error('address') != ''){

                                    $fieldAddress = 'form-error';

                                    $inputAddressError = 'error-input';

                                }

                                if(form_error('mobile') != ''){

                                    $fieldMobile = 'form-error';

                                    $inputMobileError = 'error-input';

                                }

                                

                            ?>


	                           

								<fieldset>

                                    <p class='<?php echo $fieldCodeStaff; ?>'>

										<label for="simple-input">Code Staff</label>

										<input disabled="disabled" value="<?php echo $staff['codestaff']; ?>" type="text" id="codestaff" class="round default-width-input" />

                                        
									</p>

									<p class='<?php echo $fieldFirstName; ?>'>

										<label for="simple-input">First Name</label>

										<input maxlength="100" value="<?php if(set_value('firstname')== ''):echo $staff['firstname'];else: echo set_value('firstname'); endif;?>" type="text" id="firstname" name="firstname" class="round default-width-input <?php echo $inputFirstNameError; ?>" />

                                        <?php echo form_error('firstname', '<em>', '</em>'); ?>

									</p>

									

									<p class='<?php echo $fieldLastName; ?>'><!--class="form-error"-->

										<label for="simple-input">Last Name</label>

										<input maxlength="100" value="<?php if(set_value('lastname')== ''):echo $staff['lastname'];else: echo set_value('lastname'); endif; ?>" type="text" id="lastname" name="lastname" class="round default-width-input <?php echo $inputLastNameError; ?>" />

                                        <?php echo form_error('lastname', '<em>', '</em>'); ?>							

									</p>
                                    
                                    <p class='<?php echo $fieldAddress; ?>'><!--class="form-error"-->

										<label for="simple-input">Address</label>

										<input maxlength="250" value="<?php if(set_value('address')== ''):echo $staff['address'];else: echo set_value('address'); endif; ?>" type="text" id="address" name="address" class="round default-width-input <?php echo $inputAddressError; ?>" />

                                        <?php echo form_error('address', '<em>', '</em>'); ?>							

									</p>

                                    
									<input type="submit" value="Edit" name="submit" class="round blue ic-right-arrow" />

								</fieldset>

							

						</div> <!-- end half-size-column -->
                        <div class="half-size-column fl">

								
                                    <p><!--class="form-error"-->

										<label for="simple-input">Department</label>
										<select id="dropdown-actions" name="department">
                                            <?php foreach($department as $d): ?>
                                                <?php if($staff['iddepartment'] == $d['iddepartment']): $selected = 'selected'; else: $selected = ''; endif; ?>
                                                <option <?php echo $selected; ?> value="<?php echo $d['iddepartment'] ?>"><?php echo $d['name']; ?></option>
                                            <?php endforeach; ?>
										</select>								

									</p>

                                    <p><!--class="form-error"-->

										<label for="simple-input">Gender</label>

										<?php

                                            $male = '';

                                            $female = '';

                                            if($staff['gender'] == 1){

                                                $male = 'selected';

                                            }else{

                                                $female = 'selected';

                                            }

                                        ?>

										<select id="dropdown-actions" name="gender">

											<option value="1" <?php echo $male; ?> >Male</option>

                                            <option value="0" <?php echo $female; ?> >Female</option>

										</select>

                                        <em></em>								

									</p>

                                    <p class='<?php echo $fieldMobile; ?>'><!--class="form-error"-->

										<label for="simple-input">Mobile</label>

										<input maxlength="20" value="<?php if(set_value('mobile')== ''):echo $staff['mobile'];else: echo set_value('mobile'); endif; ?>" type="text" id="mobile" name="mobile" class="round default-width-input <?php echo $inputMobileError; ?>" />

                                        <?php if(form_error('mobile') != ''): echo form_error('mobile', '<em>', '</em>'); else: echo '<em> allow with format: (XXX)XXX-XXXX</em>'; endif; ?>								

									</p>

									<p>

										<label>Status</label>

										<label for="selected-checkbox" class="alt-label">

                                            <input type="checkbox" id="selected-checkbox" name="status" value="1" checked="checked" />active

                                        </label>

									</p>

	   
								</fieldset>

							

							

						

						</div> <!-- end half-size-column -->
				        </form>

					</div> <!-- end content-module-main -->

					

				</div> <!-- end content-module -->

	

				

			</div> <!-- end side-content -->

		

		</div> <!-- end full-width -->

			

	</div> 

	<!-- end content -->

	

	

	

	<!-- FOOTER -->

	<?=$footer?>

    <!-- end footer -->



</body>

</html>